package goods.domain;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.Value;
import org.springframework.boot.autoconfigure.domain.EntityScan;

import javax.persistence.*;

@Data
@Entity
@EqualsAndHashCode(callSuper = false)
@TableName(value="goods")
public class Goods implements Serializable {

    //private static final long serialVersionUID = 1L;

    @Id
    @GeneratedValue(strategy = GenerationType.AUTO)
    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;

    private String name;

    private Integer amount;

    private Double price;

    //供应商
    @OneToMany(fetch = FetchType.EAGER, cascade = CascadeType.REFRESH)
    List<Supplier> supplierList = new ArrayList<>();

}


